package com.efast.dmom.mgmt.bean.mes.report;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 整车质量指标
 * @author Administrator
 *
 */
public class VehicleQualityIndexBean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -4462099012658923921L;
	
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date createTime;
	
	private int plantId;
	private String plantNameC;//工厂
	
	private String workshopNameC;//车间
	
	private String carModel;//车型
	
	private int dayCarQty;//每日车辆总数
	
	private int weekCarQty;//每周车辆总数
	
	private int monthCarQty;//每月车辆总数
	
	private int dayDefectCarQty;//每日各质量门发现的缺陷车辆
	
	private int weekDefectCarQty;//每周各质量门发现的缺陷车辆
	
	private int monthDefectCarQty;//每月各质量门发现的缺陷车辆
	
	private int dayDefectQty;//每日质量缺陷总数
	
	private int weekDefectQty;//每周质量缺陷总数
	
	private int monthDefectQty;//每月质量缺陷总数
	
	private String dayDPV;//每日单台缺陷项次
	
	private String weekDPV;//每周单台缺陷项次
	
	private String monthDPV;//每月单台缺陷项次
	
	private double dayDPVData;
	private double weekDPVData;
	private double monthDPVData;
	
	private double dayFTQ;//每日总装各质量门一次交检合格率
	
	private double weekFTQ;//每周总装各质量门一次交检合格率
	
	private double monthFTQ;//每月总装各质量门一次交检合格率
	
	private double dayFTQData;
	
	private String dayFPY;//每日直通率
	
	private String weekFPY;//每周直通率
	
	private String monthFPY;//每月直通率
	
	private double dayFPYData;
	private double weekFPYData;
	private double monthFPYData;
	
	public double getDayFPYData() {
		return dayFPYData;
	}

	public void setDayFPYData(double dayFPYData) {
		this.dayFPYData = dayFPYData;
	}

	public double getWeekFPYData() {
		return weekFPYData;
	}

	public void setWeekFPYData(double weekFPYData) {
		this.weekFPYData = weekFPYData;
	}

	public double getMonthFPYData() {
		return monthFPYData;
	}

	public void setMonthFPYData(double monthFPYData) {
		this.monthFPYData = monthFPYData;
	}

	private double FPY;
	
	public double getDayDPVData() {
		return dayDPVData;
	}

	public void setDayDPVData(double dayDPVData) {
		this.dayDPVData = dayDPVData;
	}

	public double getWeekDPVData() {
		return weekDPVData;
	}

	public void setWeekDPVData(double weekDPVData) {
		this.weekDPVData = weekDPVData;
	}

	public double getMonthDPVData() {
		return monthDPVData;
	}

	public void setMonthDPVData(double monthDPVData) {
		this.monthDPVData = monthDPVData;
	}

	public double getFPY() {
		return FPY;
	}

	public void setFPY(double fPY) {
		FPY = fPY;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getPlantNameC() {
		return plantNameC;
	}

	public void setPlantNameC(String plantNameC) {
		this.plantNameC = plantNameC;
	}

	public String getWorkshopNameC() {
		return workshopNameC;
	}

	public void setWorkshopNameC(String workshopNameC) {
		this.workshopNameC = workshopNameC;
	}

	public String getCarModel() {
		return carModel;
	}

	public void setCarModel(String carModel) {
		this.carModel = carModel;
	}

	public int getDayCarQty() {
		return dayCarQty;
	}

	public void setDayCarQty(int dayCarQty) {
		this.dayCarQty = dayCarQty;
	}

	public int getWeekCarQty() {
		return weekCarQty;
	}

	public void setWeekCarQty(int weekCarQty) {
		this.weekCarQty = weekCarQty;
	}

	public int getMonthCarQty() {
		return monthCarQty;
	}

	public void setMonthCarQty(int monthCarQty) {
		this.monthCarQty = monthCarQty;
	}

	public int getDayDefectQty() {
		return dayDefectQty;
	}

	public void setDayDefectQty(int dayDefectQty) {
		this.dayDefectQty = dayDefectQty;
	}

	public int getWeekDefectQty() {
		return weekDefectQty;
	}

	public void setWeekDefectQty(int weekDefectQty) {
		this.weekDefectQty = weekDefectQty;
	}

	public int getMonthDefectQty() {
		return monthDefectQty;
	}

	public void setMonthDefectQty(int monthDefectQty) {
		this.monthDefectQty = monthDefectQty;
	}

	public String getDayDPV() {
		return dayDPV;
	}

	public void setDayDPV(String dayDPV) {
		this.dayDPV = dayDPV;
	}

	public String getWeekDPV() {
		return weekDPV;
	}

	public void setWeekDPV(String weekDPV) {
		this.weekDPV = weekDPV;
	}

	public String getMonthDPV() {
		return monthDPV;
	}

	public void setMonthDPV(String monthDPV) {
		this.monthDPV = monthDPV;
	}

	public String getDayFPY() {
		return dayFPY;
	}

	public void setDayFPY(String dayFPY) {
		this.dayFPY = dayFPY;
	}

	public String getWeekFPY() {
		return weekFPY;
	}

	public void setWeekFPY(String weekFPY) {
		this.weekFPY = weekFPY;
	}

	public String getMonthFPY() {
		return monthFPY;
	}

	public void setMonthFPY(String monthFPY) {
		this.monthFPY = monthFPY;
	}

	public int getDayDefectCarQty() {
		return dayDefectCarQty;
	}

	public void setDayDefectCarQty(int dayDefectCarQty) {
		this.dayDefectCarQty = dayDefectCarQty;
	}

	public int getWeekDefectCarQty() {
		return weekDefectCarQty;
	}

	public void setWeekDefectCarQty(int weekDefectCarQty) {
		this.weekDefectCarQty = weekDefectCarQty;
	}

	public int getMonthDefectCarQty() {
		return monthDefectCarQty;
	}

	public void setMonthDefectCarQty(int monthDefectCarQty) {
		this.monthDefectCarQty = monthDefectCarQty;
	}

	public double getDayFTQ() {
		return dayFTQ;
	}

	public void setDayFTQ(double dayFTQ) {
		this.dayFTQ = dayFTQ;
	}

	public double getWeekFTQ() {
		return weekFTQ;
	}

	public void setWeekFTQ(double weekFTQ) {
		this.weekFTQ = weekFTQ;
	}

	public double getMonthFTQ() {
		return monthFTQ;
	}

	public void setMonthFTQ(double monthFTQ) {
		this.monthFTQ = monthFTQ;
	}

    @Override
    public boolean equals(Object object) {
        
        if (this == object) {
            return true;
        }
        if (object instanceof VehicleQualityIndexBean) {
        	VehicleQualityIndexBean vehicleQualityIndexBean = (VehicleQualityIndexBean) object;
            return this.carModel.equals(vehicleQualityIndexBean.carModel) 
                    && this.plantNameC.equals(vehicleQualityIndexBean.plantNameC)
                    && this.dayFPY.equals(vehicleQualityIndexBean.dayFPY)
                    && this.weekFPY.equals(vehicleQualityIndexBean.weekFPY)
                    && this.monthFPY.equals(vehicleQualityIndexBean.monthFPY)
                    && VehicleQualityIndexBean.isTheSameDay(this.createTime, vehicleQualityIndexBean.createTime);
        }
        return super.equals(object);
    }
    
    //判断是否是同一天
    public static boolean isTheSameDay(Date d1,Date d2) {   
        Calendar c1 = Calendar.getInstance();   
        Calendar c2 = Calendar.getInstance();   
        c1.setTime(d1);   
        c2.setTime(d2);   
        return (c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR))   
                && (c1.get(Calendar.MONTH) == c2.get(Calendar.MONTH))   
                && (c1.get(Calendar.DAY_OF_MONTH) == c2.get(Calendar.DAY_OF_MONTH));   
    }

	public int getPlantId() {
		return plantId;
	}

	public void setPlantId(int plantId) {
		this.plantId = plantId;
	}

	public double getDayFTQData() {
		return dayFTQData;
	}

	public void setDayFTQData(double dayFTQData) {
		this.dayFTQData = dayFTQData;
	}  
}
